package org.aceor.mddal.unit.common.zk;

import org.aceor.mddal.common.utils.NetUtil;
import org.aceor.mddal.common.zk.DynConfigClientFactory;

import java.util.List;

/**
 * Created by lxue on 16/5/26.
 */
public class Main {
    public static void main(String[] args) {
        try {
            System.out.println("Host ip :" + NetUtil.getLocalHost());
            List<String> nodes = DynConfigClientFactory.getConfigClient().getNodes("/configs/sequence");
            for (String node : nodes) {
                System.out.println(node);
            }

//            DynConfigClientFactory.getConfigClient().setConfig("/configs/sequence/192.168.23.12","2");

            System.out.println(DynConfigClientFactory.getConfigClient().getConfig("/configs/sequence/192.168.23.12"));
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
